import esp



def demo():
    esp.osdebug(None)       # turn off vendor O/S debugging messages
    esp.osdebug(0)          # redirect vendor O/S debugging messages to UART(0)

    print(esp.flash_size())

    print(esp.flash_user_start())

    esp.flash_erase(1000)
    esp.flash_write(4096 * 1000, '112233')
    buf = bytearray(10)
    esp.flash_read(4096 * 1000, buf)
    print(buf)

    esp.set_usbreple(0)
    print(esp.get_usbreple())

        
if __name__ == '__main__':
    demo()